﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>NewsAdminGroupNodeForm</title>
</head>
<body>
<form id="formx" name="formx" method="post" enctype="multipart/form-data">
<div class="easyui-layout" fit="true" style="padding: 0px;">
    <div data-options="region:'north',split:false," style="height: 34px; overflow: hidden;">
        <div id="dlg-toolbar">
            <table style="width: 100%; margin: 0px; padding: 0px;">
                <tr>
                    <td style="padding-left: 2px">
                        <a id="btnSave" href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true,">保存</a>
                        <a id="btnHelp" href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-help',plain:true,">帮助</a>
                        <a id="btnClose" href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-no',plain:true,">关闭</a>
                    </td>
                    <td style="text-align: right; padding-right: 2px"><input class="easyui-searchbox" data-options="prompt:'关键字'" style="width: 150px" /></td>
                </tr>
            </table>
        </div>
    </div>
    <div data-options="region:'center'," style="padding: 1px;">
        <div class="easyui-tabs" border="true" fit="true" data-options="tools:'#tab-tools1',">
            <div title="基本管理" style="padding: 1px;">
                <div id="NodeBase" class="easyui-panel" data-options="title:'节点管理·基本',iconCls:'icon-acc'," style="width: 100%; height: 100%; overflow: hidden;">
                    <table class="nowraptd" style="width: 100%; height: auto; border-collapse: collapse; border: 1px;">
                        <tr>
                            <td style="width: 64px;">&nbsp;节点名称：</td>
                            <td><input id="Title" name="Title" class="easyui-textbox" style="width: 100%;" type="text" data-options="required:false,prompt:'节点名称',iconWidth:120," /></td>
                            <td style="width: 120px;"><input id="FlagTop" type="checkbox" value="1" /> 设为链接</td>
                        </tr>
                        <tr>
                            <td style="width: 64px;">&nbsp;文 件 夹：</td>
                            <td><input id="Folder" name="Folder" class="easyui-textbox" style="width: 100%;" type="text" data-options="required:false,prompt:'输入网址，如：http://www.baidu.com/',iconWidth:120," /></td>
                            <td>所访问的文件夹地址。</td>
                        </tr>
                        <tr>
                            <td style="width: 64px;">&nbsp;链接地址：</td>
                            <td><input id="Url" name="Url" class="easyui-textbox" style="width: 100%;" type="text" data-options="required:false,prompt:'输入网址，如：http://www.baidu.com/',iconWidth:120," /></td>
                            <td>转向所指定的地址。</td>
                        </tr>
                        <tr>
                            <td style="width: 64px;">&nbsp;访问状态：</td>
                            <td>
                                <input id="FlagStatus1" name="FlagStatus" type="radio" value="0" /> 未审
                                <input id="FlagStatus2" name="FlagStatus" type="radio" value="1" /> 已审
                                <input id="FlagStatus3" name="FlagStatus" type="radio" value="2" /> 停止
                            </td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td style="width: 64px;">&nbsp;菜单显示：</td>
                            <td>
                                <input id="flagMenu1" name="flagMenu" type="radio" value="1" /> 是
                                <input id="flagMenu2" name="flagMenu" type="radio" value="0" /> 否
                            </td>
                            <td>&nbsp;</td>
                        </tr>
                    </table>
                </div>
            </div>
            <div title="模板指定" style="padding: 1px">
                <div id="NodeTemplate" class="easyui-panel" data-options="title:'节点模板',iconCls:'icon-acc'," style="width: 100%; height: 100%;">
                    <table class="nowraptd" style="width: 100%; height: auto; border-collapse: collapse; border: 1px;">
                        <tr>
                            <td style="width: 64px;">&nbsp;首页：</td>
                            <td><input id="TemplateIndex" name="TemplateIndex" class="easyui-textbox" style="width: 100%;" type="text" data-options="required:false,iconWidth:120," /></td>
                            <td style="width: 120px;">&nbsp;TemplateIndex</td>
                        </tr>
                        <tr>
                            <td style="width: 64px;">&nbsp;节点页：</td>
                            <td><input id="TemplateNode" name="TemplateNode" class="easyui-textbox" style="width: 100%;" type="text" data-options="required:false,iconWidth:120," /></td>
                            <td style="width: 120px;">&nbsp;TemplateNode</td>
                        </tr>
                        <tr>
                            <td style="width: 64px;">&nbsp;列表页：</td>
                            <td><input id="TemplateList" name="TemplateList" class="easyui-textbox" style="width: 100%;" type="text" data-options="required:false,iconWidth:120," /></td>
                            <td style="width: 120px;">&nbsp;TemplateList</td>
                        </tr>
                        <tr>
                            <td style="width: 64px;">&nbsp;内容页：</td>
                            <td><input id="TemplateView" name="TemplateView" class="easyui-textbox" style="width: 100%;" type="text" data-options="required:false,iconWidth:120," /></td>
                            <td style="width: 120px;">&nbsp;TemplateView</td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
</form>
<script type="text/javascript">
    (function($) {
        window.xbase.logonNo(); // 访问本页面，如已登录则跳转到index.html。
        window.xbase.closeDialog('#btnClose', '#dialog1');
        window.xbase.openDialog('#btnHelp', '#dialog2', '/Html/Acc/Staff/HelpListForm.html', '系统帮助');
        var action = $('#Action').val();
        var dgid = window.xbase.getDataGridItem('#datagrid1');
        var tvid = window.xbase.getTreeViewItem('#treeview1');
        var nodeId = dgid ? dgid : tvid ? tvid : 0;
        var datas = 'id=' + nodeId + '&action=' + action + '&url=' + window.location.pathname + '&rnd=' + Math.random();
        $.ajax({
            url: '/Ashx/Acc/Staff/NewsAdminGroupNodeView.ashx?' + datas,
            data: datas,
            method: 'post',
            success: function(result) {
                $('#formx').form('load', window.xbase.json(result));
            },
        });
        $('#btnSave').click(function() {
            $('#formx').form('submit', {
                url: '/Ashx/Acc/Staff/NewsAdminGroupNodeFormSubmit.ashx?' + datas,
                dataType: 'json',
                data: datas,
                success: function(result) {
                    if (result == null || result == '') return window.xbase.return('系统错误', 'Ajax返回空值，请稍后重试！<br />ps:如果您使用了360浏览器，请换之！', 'error');
                    var json = window.xbase.json(result);
                    if (json.error == 0) {
                        if (!$('#treeview1').tree('getSelected'))
                            $('#treeview1').tree('reload');
                        else {
                            $('#treeview1').tree('expand', node.target); //必须先展开，再追加数据。
                            if (action == 'ActNew') {
                                $('#treeview1').tree('append', {
                                    parent: (node ? node.target : null),
                                    data: [{ id: json.id, text: json.text + '[' + json.id + ']', attributes: json.attributes, }]
                                });
                            }
                            if (action == 'ActEdit') $('#treeview1').tree('reload', $('#treeview1').tree('getSelected') ? $('#treeview1').tree('getSelected').target : $('#treeview1').tree('getRoot').target); //未选择树节点，则选择根。
                        }
                        $("#datagrid1").datagrid('reload');
                        $('#dialog1').dialog('close');
                    }
                    $.messager.alert('提示信息', json.message.m_StringValue, 'info');
                }
            });
        });
    })(jQuery);
</script>
</body>
</html>
